package nix.struts.api;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class Demo2Action extends ActionSupport {

	@Override
	public String execute() throws Exception {
		
		// 获得原生Servlet的Request
		HttpServletRequest requestScope = ServletActionContext.getRequest();
		// 获得原生Servlet的Response
		HttpServletResponse responseScope = ServletActionContext.getResponse();
		// 获得原生ServletContext
		ServletContext servletContext = ServletActionContext.getServletContext();
		// 获得原生Servlet的Session
		HttpSession sessionScope = ServletActionContext.getRequest().getSession();
		
		return SUCCESS;
	}
}
